package com.ws.mapper;

import com.ws.bean.Carousel;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface CarouselMapper {

    @Insert("insert into carousels(route_id,carousel_order,ImageURL) values(#{route_id},#{carousel_order},#{ImageURL})")
    int add(Carousel carousel);

    List<Carousel> list();

    @Delete("delete from carousels where carousel_id = #{carouselId}")
    int delete(Integer carouselId);

    @Select("select * from carousels where carousel_id = #{carouselId}")
    Carousel getCarouselById(Integer carouselId);

    @Update("update carousels set carousel_order = #{carousel_order} where carousel_id = #{carousel_id}")
    int update(Carousel carousel);
}
